﻿<UserControl x:Class="SeriesEpisodeMapper.Views.DelimeterSelector"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://scxhemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Padding="5" Height="Auto">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Row="0" Grid.Column="0" Margin="5,2" VerticalAlignment="Center" TextAlignment="Right" FontStyle="Italic" Text="Select data delimeter: " />
        <ComboBox Grid.Row="0" Grid.Column="1" Margin="0,3" VerticalAlignment="Center" 
                  ItemsSource="{Binding AllDataDelimeter}" SelectedItem="{Binding SelectedDataDelimeter, Mode=TwoWay}">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding DisplayText}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
            <ComboBox.ToolTip>
                <TextBlock Text="{Binding SelectedDataDelimeter.DisplayText}" />
            </ComboBox.ToolTip>
        </ComboBox>
        <TextBlock Grid.Row="1" Grid.Column="0" Margin="5,2" VerticalAlignment="Center" TextAlignment="Right" FontStyle="Italic" Text="Select field delimeter: " />
        <ComboBox Grid.Row="1" Grid.Column="1" Margin="0,3" VerticalAlignment="Center" 
                  ItemsSource="{Binding AllFieldDelimeter}" SelectedItem="{Binding SelectedFieldDelimeter, Mode=TwoWay}">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding DisplayText}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
            <ComboBox.ToolTip>
                <TextBlock Text="{Binding SelectedFieldDelimeter.DisplayText}" />
            </ComboBox.ToolTip>
        </ComboBox>
        <UniformGrid Grid.Row="2" Grid.ColumnSpan="2" Margin="30,3" Height="25" Columns="2">
            <Button Style="{StaticResource ButtonStyleLeft}" Content="Save delimeter" Command="{Binding SaveDelimeterCommand}">
                <Button.ToolTip>
                    <TextBlock Text="Save delimeter selections" />
                </Button.ToolTip>
            </Button>
            <Button Name="btnLoad" Content="Load source" Style="{StaticResource ButtonStyleRight}" Command="{Binding LoadSourceCommand}">
                <Button.ToolTip>
                    <TextBlock Text="Load episode data from source file" />
                </Button.ToolTip>
            </Button>
        </UniformGrid>
    </Grid>
</UserControl>
